package com.bit.cfdi.web.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.bit.cfdi.web.dao.PersonaDAO;
import com.bit.cfdi.web.domain.Persona;
@Service
public class PersonaService {

	@Autowired PersonaDAO personaDAO;
	
	public void save(Persona persona)  throws DataAccessException {
		personaDAO.save(persona);
	}

	public Persona getById(Long id) throws DataAccessException {
		return personaDAO.getById(id);
	}

	public List<Persona> getAll() throws DataAccessException {
		return personaDAO.getAll();
	}

	public Persona getByRFCAndName(String rfc, String name) throws DataAccessException {
		return personaDAO.getByRFCAndName(rfc, name);
	}

}
